package com.gurun.gateway;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.gurun.base.Logger;

/**
 * Created by harry on 2018/3/21.
 * 接收开机自启动广播
 */

public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Logger.d("收到了开机自启动广播====");
        if (intent.getAction().equals("android.media.AUDIO_BECOMING_NOISY")) {
            context.startService(new Intent(context, MainService.class));
        }
    }
}
